<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Cmspage
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */

class Cmspage_Form_Admin_Global extends Engine_Form {
	public function init() {
		$this->setTitle ( 'Global Settings' )->setDescription ( 'These settings affect all members in your community.Nulled by Maslik.' );
		
		$this->addElement ( 'Radio', 'cmspage_public', array ('label' => 'Public Permissions', 'description' => "CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_PUBLIC_DESCRIPTION", 'multiOptions' => array (1 => 'Yes, the public can view pages unless they are made private.', 0 => 'No, the public cannot view pages.' ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.public', 1 ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_sorting', array ('label' => 'Sorting Priority', 'description' => "CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SORTING_DESCRIPTION", 'multiOptions' => array (0 => "User preference", 1 => "Sticky pages, then user preference", 2 => "Sticky pages, featured pages, then user preference", 3 => "Featured pages, then user preference", 4 => "Featured pages, sticky pages, then user preference" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.sorting', 1 ) ) );
		
		$this->addElement ( 'Text', 'cmspage_page', array ('label' => 'Browse Pages', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_PAGE_DESCRIPTION', 'class' => 'short', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.page', 20 ), 'validators' => array ('Digits', new Zend_Validate_Between ( 1, 100 ) ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_pagedetails', array (//'label' => '',
		'description' => "CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_PAGEDETAILS_DESCRIPTION", 'multiOptions' => array (1 => 'Yes, show those information.', 0 => 'No, do not show those information.' ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.pagedetails', 0 ) ) );
		
		$this->addElement ( 'Text', 'cmspage_gallery', array ('label' => 'Page Photos', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_GALLERY_DESCRIPTION', 'class' => 'short', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.gallery', 3 ) ) );
		
		$this->addElement ( 'Text', 'cmspage_homerecentmax', array ('label' => 'Recently Posted Pages', 'description' => 'How many pages will be shown in the Recently Posted section? (Enter a number between 0 and 10)', 'class' => 'short', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.homerecentmax', 5 ), 'validators' => array ('Digits', new Zend_Validate_Between ( 0, 10 ) ) ) );
		
		$this->addElement ( 'Text', 'cmspage_homestickymax', array ('label' => 'Sticky Pages', 'description' => 'How many pages will be shown in the Sticky section? (Enter a number between 0 and 10)', 'class' => 'short', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.homestickymax', 3 ), 'validators' => array ('Digits', new Zend_Validate_Between ( 0, 10 ) ) ) );
		
		$this->addElement ( 'Text', 'cmspage_hometagsmax', array ('label' => 'Popular Tags', 'description' => 'How many tags will be shown in the Popular Tags section? (Enter a number between 0 and 100)', 'class' => 'short', 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.hometagsmax', 50 ), 'validators' => array ('Digits', new Zend_Validate_Between ( 0, 100 ) ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_showlayout', array ('label' => 'Page View Layout', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SHOWLAYOUT_DESCRIPTION', 'multiOptions' => array (0 => "No, do not apply global layout for page view.", 1 => "Yes, always apply global layout for page view.", 2 => "Make this a member preference setting per page" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.showlayout', 2 ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_showtitle', array ('label' => 'Display Page Title', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SHOWTITLE_DESCRIPTION', 'multiOptions' => array (0 => "No, do not display page title above body content.", 1 => "Yes, force page title to be displayed above body content.", 2 => "Make this a member preference setting per page" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.showtitle', 0 ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_showphoto', array ('label' => 'Display Page Photos', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SHOWPHOTO_DESCRIPTION', 'multiOptions' => array (0 => "No, do not display photo gallery section.", 1 => "Yes, display photo gallery section if page has photos uploaded.", 2 => "Make this a member preference setting per page" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.showphoto', 2 ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_showinfo', array ('label' => 'Display Page Information', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SHOWINFO_DESCRIPTION', 'multiOptions' => array (0 => "No, do not display page info section.", 1 => "Yes, always display page info section.", 2 => "Make this a member preference setting per page" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.showinfo', 2 ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_showtool', array ('label' => 'Display Page Tools', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SHOWTOOL_DESCRIPTION', 'multiOptions' => array (0 => "No, do not display page tool section.", 1 => "Yes, always display page tool section.", 2 => "Make this a member preference setting per page" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.showtool', 2 ) ) );
		
		$this->addElement ( 'Radio', 'cmspage_showcomment', array ('label' => 'Display Page Comments', 'description' => 'CMSPAGE_FORM_ADMIN_GLOBAL_CMSPAGE_SHOWCOMMENT_DESCRIPTION', 'multiOptions' => array (0 => "No, do not display page comment section.", 1 => "Yes, always display page comment section.", 2 => "Make this a member preference setting per page" ), 'value' => Engine_Api::_ ()->getApi ( 'settings', 'core' )->getSetting ( 'cmspage.showcomment', 2 ) ) );
		
		// Add submit button
		$this->addElement ( 'Button', 'submit', array ('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true ) );
	}
}